package com.inspinia.base.dao.db;

import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

/**
 * 路由数据源的ThreadLocal
 *
 * @author veblen
 * @date 2017/1/10
 */
public class ThreadLocalRoutingDataSource extends AbstractRoutingDataSource {


    @Override
    protected Object determineCurrentLookupKey() {
        DataSources dataSources = DataSourceTypeManager.get();
//        System.out.println("这次使用的是：" + dataSources + " 线程名：" + Thread.currentThread().getName());
        return dataSources;
    }


}
